public class TextHelper
{
    public void WritTXT(string filename, string txt)
    {
        string path= Path.GetDirectoryName(filename);
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        File.WriteAllText(filename, txt);
    }
    public string ReadTXT(string path)
    {
        try
        {
            if (path.Contains(":") || path.StartsWith("/"))
            {

            }
            else
            {
                path = AppDomain.CurrentDomain.BaseDirectory + path;
            }
            string str = File.ReadAllText(path);
            return str;///读取
        }
        catch
        {
            return "";
        }
    }
}